package mall;

/**
 * @author jj
 * @date 2019/11/20 9:53
 */
public class pai {
        public static void main(String[] args)
        {
            send c1=new send();
            c1.chushihua();
            c1.xipai();
            c1.fapai();
        }

}
class sendPoke
{
    private String num,type;

    public sendPoke(String t,String n)
    {
        this.type = t;
        this.num = n;
    }

    public String toString()
    {
        return type+" "+num+"  ";
    }
}

class send
{
    sendPoke poke[];
    public void chushihua()
    {
        poke = new sendPoke[52];
        String num[]={"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        String type[]={"方块","梅花","红桃","黑桃"};
        for(int i=0;i<52;i++)
        {
            poke[i]=new sendPoke(type[i/13],num[i%13]);
        }
    }
    public void xipai()
    {
        int count=52;
        for(int j=0;j<52;j++)
        {
            int x=(int)(Math.random()*count);
            sendPoke temp=poke[count-1];
            poke[count-1]=poke[x];
            poke[x]=temp;
            count--;
        }
    }
    public void fapai()
    {
        for(int i=0;i<52;i++)
        {
            if(i%13==0)
                System.out.println("\n");
            System.out.print(poke[i]);
        }
    }
}